package com.zoweunion.mechanic.util.task;

import com.zoweunion.mechanic.service.shangji.ShangJiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * @author zhangjun
 * @描述 数据审核的定时任务，发布维修企业、求职、招聘、租售的信息，超过3小时尚未审核的，默认审核通过
 * @Deprecated 移植到了运营平台代码上
 * @date 2019-07-19
 */
@Deprecated
//@Component
public class CheckDataScheduledTask {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    ShangJiService shangJiService;

    // @Scheduled(cron="0 0/10 * * * *")
    public void checkData() throws Exception {
        logger.info("系统执行数据审核");
        Map<String, Object> paramsMap = new HashMap<>(7);
        paramsMap.put("hour", 3 * 60 * 60);
        paramsMap.put("examine_flag", 1);
        paramsMap.put("update_user", "1");
        paramsMap.put("update_time", new Date());
        shangJiService.systemCheckData(paramsMap);
    }
}
